// mod front_of_house {
//     pub mod hosting {
//         pub fn add_to_waitlist() {}
//         fn seat_at_table() {}
//     }
//     mod serving {
//         fn take_order() {}
//         fn serve_order() {}
//         fn take_payment() {}
//     }
// }

// // use简化路径
// pub use crate::front_of_house::hosting;
// pub fn eat_at_restaurant() {
//     // 绝对路径
//     crate::front_of_house::hosting::add_to_waitlist();
//     hosting::add_to_waitlist();
//     // 相对路径
//     front_of_house::hosting::add_to_waitlist();
//     let mut meal = back_of_house::Breakfast::summer("Rye");
//     meal.toast = String::from("Wheat");
//     println!("I'd like {} toast please", meal.toast);
//     let order1 = back_of_house::Appetizer::Soup;
//     let order2 = back_of_house::Appetizer::Salad;
//     // meal.seasonal_fruit = String::from("blueberries");
// }

//super起始的相对路径,访问父类中的函数
fn deliver_order() {}
mod back_of_house {
    //公有结构体，结构体公有不代表字段公有
    pub struct Breakfast {
        pub toast: String,      //公有字段
        seasonal_fruit: String, //私有字段
    }

    //公有枚举，则所有成员均公有
    pub enum Appetizer {
        Soup,
        Salad,
    }
    impl Breakfast {
        pub fn summer(toast: &str) -> Breakfast {
            Breakfast {
                toast: String::from(toast),
                seasonal_fruit: String::from("peaches"),
            }
        }
    }
    fn fix_incorrent_order() {
        cook_order();
        super::deliver_order();
    }

    fn cook_order() {}
}
